Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jan 18, 2026

The release type calculation is now separated from cleanup logic, providing clearer control over when prereleases are cleaned up. The ReleaseType now only has three values (Release, Prerelease, or None), and cleanup is computed independently based on the AutoCleanup setting.

ReleaseType simplified to three values

Previously, ReleaseType could be set to Cleanup to trigger prerelease cleanup. Now, ReleaseType only has three values: Release, Prerelease, or None. The cleanup decision is computed separately based on:

  1. Whether you're in a cleanup scenario (merging to main or abandoning a PR)
  2. Whether AutoCleanup is enabled in your settings (defaults to true)

This separation enables the abandoned PR cleanup scenario where a PR is closed without merging—the workflow can now trigger cleanup independently of whether a release is being created.

ReleaseType moved to Publish.Module output

The computed ReleaseType value is now stored in Publish.Module.ReleaseType rather than in the Run object. This organizes release-related computed values alongside other publish settings.

Workflows should now reference:

  • fromJson(inputs.Settings).Publish.Module.ReleaseType for the release type
  • fromJson(inputs.Settings).Publish.Module.AutoCleanup for the cleanup decision (computed boolean)

AutoCleanup behavior

The AutoCleanup setting continues to work as before, but the output value is now a computed boolean that indicates whether cleanup should actually occur (based on both the setting and the current context like merged PR or abandoned PR).

@MariusStorhaug MariusStorhaug changed the title 🚀 [Feature]: Rename AutoCleanup to CleanupPrereleases and separate cleanup from release type 🌟 [Feature]: Rename AutoCleanup to CleanupPrereleases and separate cleanup from release type Jan 18, 2026
@MariusStorhaug MariusStorhaug changed the title 🌟 [Feature]: Rename AutoCleanup to CleanupPrereleases and separate cleanup from release type 🌟 [Major]: Rename AutoCleanup to CleanupPrereleases and separate cleanup from release type Jan 18, 2026
@MariusStorhaug MariusStorhaug marked this pull request as ready for review January 18, 2026 10:12
Copilot AI review requested due to automatic review settings January 18, 2026 10:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the prerelease cleanup mechanism by renaming AutoCleanup to CleanupPrereleases and separating the cleanup decision from the ReleaseType enum. The cleanup logic is now computed independently based on the PR state and user preferences, making the behavior more explicit and easier to understand.

Changes:

  • Renamed Publish.Module.AutoCleanup to Publish.Module.CleanupPrereleases for clarity
  • Removed Cleanup from the ReleaseType enum (now only Release, Prerelease, or None)
  • Moved ReleaseType and the computed CleanupPrereleases value to Publish.Module section instead of Run

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/scenarios/valid/PSModule.yml Updated test configuration to use new Publish.Module.CleanupPrereleases structure
tests/scenarios/invalid-percent-target/PSModule.yml Updated test configuration to use new Publish.Module.CleanupPrereleases structure
scripts/main.ps1 Implemented the core refactoring: renamed setting, separated cleanup logic from ReleaseType, and added computed values to Publish.Module
scripts/Settings.schema.json Updated schema to rename AutoCleanup to CleanupPrereleases, improved description, and removed 'Cleanup' from ReleaseType enum
Comments suppressed due to low confidence (1)

scripts/Settings.schema.json:181

  • The schema is missing the ReleaseType property definition in the Publish.Module section. According to the PR description and the code changes in scripts/main.ps1 (line 433), ReleaseType is now being added as a computed property to Publish.Module. The schema should include a ReleaseType property here with the same structure as defined in the Run section (type: string, enum: ["Release", "Prerelease", "None"]).
          "properties": {
            "Skip": {
              "type": "boolean",
              "description": "Skip module publish"
            },
            "CleanupPrereleases": {
              "type": "boolean",
              "description": "When enabled (default: true), automatically cleans up old prerelease tags when merging to main or when a PR is abandoned"
            },
            "AutoPatching": {
              "type": "boolean",
              "description": "Automatically apply patches"
            },
            "IncrementalPrerelease": {
              "type": "boolean",
              "description": "Use incremental prerelease versioning"
            },
            "DatePrereleaseFormat": {
              "type": "string",
              "description": "Date format for prerelease versions"
            },
            "VersionPrefix": {
              "type": "string",
              "description": "Prefix for version tags"
            },
            "MajorLabels": {
              "type": "string",
              "description": "Comma-separated labels that trigger major version bump"
            },
            "MinorLabels": {
              "type": "string",
              "description": "Comma-separated labels that trigger minor version bump"
            },
            "PatchLabels": {
              "type": "string",
              "description": "Comma-separated labels that trigger patch version bump"
            },
            "IgnoreLabels": {
              "type": "string",
              "description": "Comma-separated labels that prevent release"
            },
            "PrereleaseLabels": {
              "type": "string",
              "description": "Comma-separated labels that trigger a prerelease"
            },
            "UsePRTitleAsReleaseName": {
              "type": "boolean",
              "description": "Use pull request title as the GitHub release name"
            },
            "UsePRBodyAsReleaseNotes": {
              "type": "boolean",
              "description": "Use pull request body as the release notes content"
            },
            "UsePRTitleAsNotesHeading": {
              "type": "boolean",
              "description": "Add pull request title as H1 heading in release notes"
            }
          }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 18, 2026 12:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MariusStorhaug MariusStorhaug changed the title 🌟 [Major]: Rename AutoCleanup to CleanupPrereleases and separate cleanup from release type 🌟 [Major]: Rename AutoCleanup to CleanupPrereleases and separate cleanup from release type Jan 18, 2026
Copilot AI review requested due to automatic review settings January 18, 2026 13:53
@MariusStorhaug MariusStorhaug changed the title 🌟 [Major]: Rename AutoCleanup to CleanupPrereleases and separate cleanup from release type 🚀 [Feature]: Separate cleanup from release type and move ReleaseType to Publish.Module Jan 18, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MariusStorhaug MariusStorhaug merged commit 28c1805 into main Jan 18, 2026
15 checks passed
@MariusStorhaug MariusStorhaug deleted the cleanup branch January 18, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants